﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StoreHouseA
{
    using StoreHouseDataSetTableAdapters;

    public partial class Form6 : Form
    {
        public Form6()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            insert_locationc();
            this.Close();
        }

        private void insert_locationc()
        {
            string in_customer = comboBox2.Text;
            string in_code = comboBox3.Text;
            string in_level = comboBox4.Text;
            string in_old = comboBox1.Text;
            string in_new = textBox3.Text;
            decimal in_weight = numericUpDown1.Value;
            DateTime in_date = dateTimePicker1.Value.Date;
            string in_memo = textBox4.Text;

            string in_oman = Program.oman;
            DateTime in_otime = DateTime.Now;

            tb_inoutTableAdapter a = new tb_inoutTableAdapter();
            a.Insert(in_code, in_level, in_customer, in_old, 0, in_weight,
                in_date, "", "", "", "", in_new, "", in_oman, in_otime);
            a.Insert(in_code, in_level, in_customer, in_new, in_weight, 0,
                in_date, "", "", "", "", in_old, "", in_oman, in_otime);
        }

        private void button1_Click(object sender, EventArgs e)
        {
        }

        private void textBox1_Click(object sender, EventArgs e)
        {
        }

        private void textBox2_Click(object sender, EventArgs e)
        {
        }

        private void textBox3_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == (new Form17()).ShowDialog())
            {
                textBox3.Text = Form17.location_name;
            }
        }
    }
}
